#include<iostream>
#include<vector>
using namespace std;
const int N=1e6+10;
bool cmp(vector<int> &a,vector<int>&b){
  if(a.size()!=b.size()) return a.size()<b.size();
  else for(int i=a.size();i>=0;i--){
    if(a[i]!=b[i]) return b[i]>a[i];
  }
}
vector<int> sub(vector<int> &a,vector<int>&b){
  vector<int>c;
  int t=0;
  for(int i=0;i<a.size();i++){
    t+=a[i];
    if(i<b.size()) t-=b[i];
    c.push_back((t+10)%10);
    if(t<0)t=-1;
    else t=0;
  }
  while(c.size()>1&&c.back()==0) c.pop_back();
  return c;
}
int main(){
  string A,B;
  vector<int>a,b;
  cin>>A>>B;
  for(int i=A.size()-1;i>=0;i--) a.push_back(A[i]-'0');
  for(int i=B.size()-1;i>=0;i--) b.push_back(B[i]-'0');
  bool flag=cmp(a,b);
  auto c=(flag)?sub(b,a):sub(a,b);
  if(flag)cout<<"-";
  for(int i=c.size()-1;i>=0;i--)cout<<c[i];
}